<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    div {
        display: flex;
    }

    span {
        width: 50px;
        height: 50px;
        text-align: center;
        background-color: pink;
        line-height: 50px;
        border: 1px solid;
        margin-right: 10px;
    }
</style>

<body>
    <div>
        <span class="h">1</span>
        <span class="m">2</span>
        <span class="s">3</span>
    </div>
    <script>
        var myh = document.querySelector('.h');
        var mym = document.querySelector('.m');
        var mys = document.querySelector('.s');
        var input = new Date('2022-10-6 11:44:00');
        countDown();
        //写一个计算倒计时的函数
        function countDown() {
            var nowTime = new Date();

            var times = (input - nowTime) / 1000;
            var h = parseInt(times / 60 / 60 % 24);
            h = h < 10 ? '0' + h : h;
            myh.innerHTML = h;
            var m = parseInt(times / 60 % 60);
            m = m < 10 ? '0' + m : m;
            mym.innerHTML = m;
            var s = parseInt(times % 60);
            s = s < 10 ? '0' + s : s;
            mys.innerHTML = s;
        }
        setInterval(countDown, 1000);

        // countDown(11: 39)
    </script>
</body>

</html>